<template>
  <div class="box7">
    <div class="title">
      <p>年度游客量对比</p>
      <img src="../../images/dataScreen-title.png" alt="" />
    </div>
    <!-- 图形图表的容器 -->
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import * as echarts from 'echarts'
let charts = ref()

onMounted(() => {
  let mychart = echarts.init(charts.value)
  //一个容器展示多种类型的图形图标
  mychart.setOption({
    title: {
      text: '散点图',
      textStyle: {
        color: 'white',
      },
    },
    xAxis: {
      type: 'category',
      show: false,
    },
    yAxis: {
      show: false,
    },
    grid: {
      left: 20,
      bottom: 20,
      top: 0,
      right: 0,
    },
    series: {
      type: 'scatter',
      data: [33, 88, 43, 53, 4, 2, 34, 1],
      symbol: 'arrow',
      label: {
        show: true,
        position: 'top',
        color: 'red',
      },
    },
  })
})
</script>

<style lang="scss" scoped>
.box7 {
  width: 100%;
  height: 100%;
  background: url(../../images/dataScreen-main-cb.png) no-repeat;
  background-size: 100% 100%;

  .title {
    margin-left: 5px;

    p {
      color: white;
      font-size: 18px;
    }
  }

  .charts {
    height: calc(100% - 30px);
  }
}
</style>
